package com.rc.saas.mini.common.utils;

import org.apache.commons.lang3.StringUtils;

/**
 * Created by sven on 2018-03-08 09:49
 */
public class ValidationUtil {
    /**
     * 校验(0到两位小数)金额是否非法
     * @param amount
     * @return
     */
    public static boolean checkAmount(String amount) {
        if (StringUtils.isBlank(amount) || !amount.matches("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$")) {
            return false;
        }
        return true;
    }

}
